package util;

import java.beans.DefaultPersistenceDelegate;
import java.sql.Connection;
import java.util.List;

import dao.DEPTdao;
import dao.STUdao;

import entity.Department;

import entity.Student;

public class Test00 {

	public static void main(String[] args) {

			/*Connection con=DBUtil.getConnnection();
			STUdao sd=new STUdao();
			List<Student> stus=sd.getall();
			for (Student s : stus) 
			{
				System.out.println(s.getSTUDENTNAME()+" "+s.getSTUDENTID()+" "+s.getSTUDENTADDRESS()+" "+s.getDepart().getDEPARTMENTNAME());
			}*/
			/*DEPTdao dd=new DEPTdao();
			List<Department> deps=dd.getall();
			for (Department	 d : deps) {
				System.out.println(d.getDEPARTMENTNAME()+":");
				for (Student stu : d.getStuds()) {
					System.out.println(stu.getSTUDENTNAME()+" "+stu.getSTUDENTADDRESS());
				}
			}*/
		
		DEPTdao deptd=new DEPTdao();
		List<Department> depart=deptd.getall();
		for (Department d : depart) {
			System.out.println(d.getDEPARTMENTNAME()+":");
			for (Student studs : d.getStuds()) {
				System.out.println(studs.getSTUDENTNAME()+":"+" "+studs.getSTUDENTADDRESS()+" "+studs.getSTUDENTID());
				
			}
		}

	}

}
